var express = require('express')
var router = express.Router()

/* GET home page. */
router.get('/', function (req, res, next) {
  res.render('index', { title: 'Express' })
})

router.get('/api/tab', (req, res) => {
  res.send({
    code: 0,
    msg: 'success',
    data: [
      {
        id: 1,
        name: '正在上映',
        children: [
          {
            id: '1-1',
            name: '007-无暇赴死',
          },
          {
            id: '1-2',
            name: '贺岁电影',
          },
        ],
      },
      {
        id: 2,
        name: '即将上映',
        children: [
          {
            id: '2-1',
            name: '蜘蛛侠3',
          },
          {
            id: '2-2',
            name: '钢铁侠3',
          },
        ],
      },
    ],
  })
})

module.exports = router
